package base.core.exception;

/**
 * @Description
 * @Author Pengwei
 * @CreatDate 2021/12/27 17:57
 */
public class Throws {

    private Throws() {
    }

    public static ExceptionHandler If(boolean b) {
       return new ExceptionHandler(b);
    }

    public static class ExceptionHandler {
        boolean b;
        private ExceptionHandler(boolean b) {
            this.b = b;
        }


        public void of(RuntimeException exception) {
            if (b) {
                throw exception;
            }
        }
    }
}
